package GUI.common;

/**
 * 
 * @author Josep M Sobrepere
 * 
 * Classe útil a l'hora de carregar combos
 */
public class Item {
	private int id;
	private String description;
	private Object element;

	public Item(int id, String description, Object element)
	{
		this.id = id;
		this.description = description;
		this.element=element;
	}

	public int getId()
	{
		return id;
	}

	public String getDescription()
	{
		return description;
	}
	public Object getElement() {
		return element;
	}

	public String toString()
	{
		return description;
	}
	
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Item other = (Item) obj;
		if (id != other.id)
			return false;
		return true;
	}
}
